<?php

class Person
{

    public function __construct() {
        echo "person construct\n";
    }
}

$student = new class() extends Person
{

    public $name = '';

    public function __construct() {
        parent::__construct();
        echo "student construct\n";
        $this->name = 'emily';
    }
};
echo $student->name;